package states
{
	import org.flixel.*;
	import ui.SelectionMenu;
	
	public class MenuState extends FlxState
	{
		[Embed(source="../mp3/title.mp3")]
		private var TitleMusic : Class;
		
		[Embed(source="../img/title.png")]
		private var Title : Class;
		private var _menu:SelectionMenu;
		
		override public function create():void
		{
			super.create();	
			FlxG.playMusic(TitleMusic, .2);
			//FlxG.music.fadeIn(2);
		
			var sprite:FlxSprite = new FlxSprite(0, 0, Title);
			add(sprite);
		
			_menu = new SelectionMenu(10);
			
			var t:FlxText = new FlxText(0, FlxG.height - 60, FlxG.width, "Press Space");
			t.size = 16;
			t.alignment = "center";
			_menu.addTextOption(t, 0xFFFF9933, newGame);
			add(_menu);
		}

		public function newGame():void
		{
			FlxG.switchState(new GamePlayState());
			
			FlxG.play(AssetStore.infect, 20);
		}
		
	}
}
